
var myemail = ""

function grabEmail()
{
   myemail = window.document.get_email_form.get_email_box.value;
   if(myemail.length == 0)
   {
      alert("Please enter your email. Then click Submit.");
   }
   else
   {
      window.document.getElementById('blank_div').style.display = "none";
      window.document.getElementById('mailto_div').style.display = "none";
      window.document.getElementById('warning_div').style.display = "block";
   }
}




function makeMailto()
{
   //var mailto_code = "<b>" + myemail + "</b>";

   var mailto_code = "";
   mailto_code += "<p style=\"text-align:center\;\"><b>Demo mailto form using <span class=\"bluetext\">" + myemail + "</span>:</b></p>";

   mailto_code += "<div style=\"background-image:url(../common/pregrad.gif)\">";
   mailto_code += "<tt class=\"ttcode\"><span class=\"redtext\">&lt\;form method=&quot\;post&quot\; action=&quot\;mailto:</span><span class=\"bluetext\">" + myemail + "</span><span class=\"redtext\">&quot\; enctype=&quot\;text/plain&quot\;&gt\;</span><br>";
   mailto_code += "<span class=\"redtext\">&lt\;input type=&quot\;text&quot\; name=&quot\;test&quot\; size=&quot\;30&quot\; &nbsp\;value=&quot\;This is a test&quot\;&gt\;</span><br>";
   mailto_code += "<span class=\"redtext\">&lt\;input type=&quot\;submit&quot\; value=&quot\;Submit&quot\;&gt\;</span><br>";
   mailto_code += "<span class=\"redtext\">&lt\;/form&gt\;</span></tt>";
   mailto_code += "</div>";

   mailto_code += "<form method=\"post\" action=\"mailto:" + myemail + "\" enctype=\"text/plain\">";
   mailto_code += "<div>";
   mailto_code += "<input type=\"text\" name=\"test\" size=\"30\"  value=\"This is a test\">";
   mailto_code += "<input type=\"submit\" value=\"Submit\">";
   mailto_code += "</div>";
   mailto_code += "</form>";

   mailto_code += "<p>Submit it to see how your setup handles and recieves mailto forms. Just remember though, all this demo does is show you how <i>your</i> system handles mailto forms. Someone elses system may handle them differently.</p>";
   mailto_code += "<p>Ideally, submitting the form would result in the form data (test=This is a test) being promptly emailed to you. Depending on your browser/email setup, you might get just that, you might see a new email message window with the form data in the body, or you might see a blank email message window, or you might see a trio of lute-playing fairies playing Hail to the Chief. At any rate, even if you see a particular something, one of your users may see a particular something <i>else</i>.</p>";

   window.document.getElementById('mailto_div').innerHTML = mailto_code;

   window.document.getElementById('warning_div').style.display = "none";
   window.document.getElementById('mailto_div').style.display = "block";
}


